<?php
//$dataProvider = new KonsumsiRapat();
echo CHtml::beginForm('#','post');
echo CHtml::dropDownList('listbulan', $selectbulan, 
              array('01' => 'Januari', 
              		'02' => 'Februari',
              		'03' => 'Maret',
              		'04' => 'April',
              		'05' => 'Mei',
              		'06' => 'Juni',	
              		'07' => 'Juli',
              		'08' => 'Agustus',
              		'09' => 'September',
              		'10' => 'Oktober',
              		'11' => 'November',
              		'12' => 'Desember',
              ),
              array('empty' => '(Pilih Bulan)'));
              
              

$tahunList = array();
for($i=2000 ; $i<2026;++$i) {
	$tahunList[] = $i;
}

echo CHtml::dropDownList('listtahun', $selecttahun, 
             $tahunList,
              array('empty' => '(Pilih Tahun)'));
echo(CHtml::submitButton('Refresh!'));
echo(CHtml::endForm());
                            
echo '<br><br>';
              
              
?>
<div id="requestAccordion">
<?php

for($i=1; $i<32; ++$i) {

$model = new KonsumsiRapat();
$model = $model->findAll("date = '$selectedtahun-$selectedbulan-$i'");

if($model != NULL){
echo KonsumsiRapat::getnamaHarifromDate($i,$selectedbulan,$selectedtahun);
echo ', tanggal '.$i.'/'.$selectedbulan.'/'.$selectedtahun;
echo '<br>';
echo '_____________________________________________________________________________________';
$this->widget('zii.widgets.grid.CGridView', array(
    'id' => 'contentrequest-grid-' . $i,
	'dataProvider'=>$model_rapat->searchByDate($selectedtahun.'-'.$selectedbulan.'-'.$i),
	'filter' => $model_rapat,
    'columns'=>array(
		array(
		
			'header' => 'Request ID',
			'name' => 'requestKonsumen.id',		
            'filter' => CHtml::activeTextField($model_rapat,'requestKonsumenId'),
			'htmlOptions' => array('style'=>'width:40px;'),
		
		),
		array(
			'header' => "Tipe Makanan",		
			'value' => '$data->getTypeMakanan()',
	   //'filter' => CHtml::activeDropDownList($model_rapat,'typeMakanan',$typeMakanan),
			'filter'=> false,
			'htmlOptions' => array('style'=>'width:130px;'),
		
		),
		array(
			'header' => "Jumlah",
			'value' => '$data->getJumlahMakanan()',
			'htmlOptions' => array('style'=>'width:130px;'),
		
		),			
		array(
			'header' => "Waktu Dibutuhkan",
			'name' => 'time_start',
			'htmlOptions' => array('style'=>'width:130px;'),
		),
	
		array(
			'header' => "Status Pesanan",	
			'name' => 'requestKonsumen.status',
			'value' => 'requestKonsumen::Model()->FindByPk($data->id)->status',
		    'filter' => CHtml::activeDropDownList($model_rapat,'requestKonsumenStatus',array(''=>'','Taken'=>'Taken','Approved'=>'Approved','Rejected'=>'Rejected','Waiting'=>'Waiting')),
		
			'htmlOptions' => array('style'=>'width:80px;'),
		),
		 array(    
        	'header' => 'Aksi',        // display a column with "view", "update" and "delete" buttons
            'class'=>'CButtonColumn',
        	'template'=> '{view}',
        
        	//'buttons'=>array(
        		//'delete' => array(
        			//'visible' => '$data->requestKonsumen->status=="waiting"'
        		//),
        	),		

    ),
));

}}

?>
</div>